# Parse yr.no weather forecast
scanner {
 Exec("wget -O - \"https://api.met.no/weatherapi/locationforecast/2.0/compact?lat=41.9028&lon=12.4964\"") {
 #file("/tmp/weather"){
    WthrTemp= Json(".properties.timeseries.1.data.instant.details.air_temperature")
    WthrCond= Json(".properties.timeseries.1.data.next_12_hours.summary.symbol_code")
  }
}

layout {
  style = "panel_item"
  label {
    interval = 600000
    #css = "* { font: 0.5cm Sans; font-weight: 700; -GtkWidget-align: 0.5; padding-left: 1mm; padding-right: 1mm; }"
    value = Str(WthrTemp.val,1)
  }
  image {
    interval = 600000
    css = "* { -GtkWidget-hexpand: true; -GtkWidget-vexpand: true; padding-left: 1mm; padding-right: 1mm;min-width: 0.5cm;min-height: 0.5cm; }"
    value = 'icons/weather/'+$WthrCond+'.svg'
  }
}
